import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
  routes: [
    // 首页
    {
      path: '/',
      name: 'home',
      component: Home
    },
    // 会员
    {
      path: '/members',
      name: 'members',
      component: () => import(/* webpackChunkName: "members" */ './views/Members.vue')
    },
    // 购物车
    {
      path: '/cart',
      name: 'cart',
      component: () => import(/* webpackChunkName: "cart" */ './views/Cart.vue')
    },
    // 搜索
    {
      path: '/search',
      name: 'search',
      component: () => import(/* webpackChunkName: "search" */ './views/Search.vue')
    },
    // 新闻资讯
    {
      path: '/newsList',
      name: 'newsList',
      component: () => import(/* webpackChunkName: "newsList" */ './views/news/newsList.vue')
    },
    // 新闻详情
    {
      path: '/getnew/:id',
      name: 'getnew',
      component: () => import(/* webpackChunkName: "getnew" */ './views/news/newsDetail.vue')
    },
    // 图片列表
    {
      path: '/imgList',
      name: 'imgList',
      component: () => import(/* webpackChunkName: "imgList" */ './views/imgs/imgList.vue')
    },
    // 图片详情
    {
      path: '/imgDetail/:id',
      name: 'imgDetail',
      component: () => import(/* webpackChunkName: "imgDetail" */ './views/imgs/imgDetail.vue')
    },
    // 商品列表
    {
      path: '/goodsList',
      name: 'goodsList',
      component: () => import(/* webpackChunkName: "goodsList" */ './views/goods/goodsList.vue')
    },
    // 商品详情
    {
      path: '/goodsDetail/:id',
      name: 'goodsDetail',
      component: () => import(/* webpackChunkName: "goodsDetail" */ './views/goods/goodsDetail.vue')
    },
    // 商品评论
    {
      path: '/goodsComment/:id',
      name: 'goodsComment',
      component: () => import(/* webpackChunkName: "goodsComment" */ './views/goods/goodsComment.vue')
    },
    // 图文介绍
    {
      path: '/goodsDesc/:id',
      name: 'goodsDesc',
      component: () => import(/* webpackChunkName: "goodsDesc" */ './views/goods/goodsDesc.vue')
    }
  ]
})
